﻿<%@ Page Language="C#" MasterPageFile="~/U_masterP.master" AutoEventWireup="true"
    CodeFile="personaInfo.aspx.cs" Inherits="personaInfo" %>

<%@ Register Src="uc_main/menu_canhan.ascx" TagName="menu_canhan" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <style>
        #content_left2
        {
            width: 100%;
            margin: 0px 0px;
            float: left;
            position: relative;
            min-height: 700px;
        }
    </style>
    <div id="content_top">
        <%--<asp:CheckBox ID="CheckBox1" runat="server"/>--%>
        <div id="kep">
            <a href="#">Trang cá nhân</a></div>
        <div id="tags">
            <div id="result">
            </div>
            <% if (Session["KhachHang"] != null)
               { %>
            <div id="Iwill">
                Tôi sẽ
                <asp:TextBox ID="TextBox1" CssClass="txtTieptuc" Width="400px" runat="server" MaxLength="150" onkeyup="valid(this,'special')" onblur="valid(this,'special')" ></asp:TextBox>
                chỉ với 5$.
                <ajaxToolkit:FilteredTextBoxExtender ID="TextBox1_FilteredTextBoxExtender" runat="server"
                    FilterMode="InvalidChars" InvalidChars="!@#$%^&amp;*()_-+=\|{}[]&quot;':,&lt;&gt;.?/"
                    TargetControlID="TextBox1">
                </ajaxToolkit:FilteredTextBoxExtender>
                <div id="btn_tieptuc">
                    <asp:Button ID="btnTiep2" CssClass="tieptuc" runat="server" OnClientClick="return checkTT()"
                        Text="Tiếp tục" /></div>
            </div>
            <% }
               else { } %>
        </div>
        <div class="muasam">
            <a href="details.aspx" title="Trở lại trang Dịch vụ">Quay lại trang Dịch vụ</a></div>
    </div>
    <div class="clear">
    </div>
    <div id="sub_content">
        <div id="content_left2">
            <uc1:menu_canhan ID="menu_canhan2" runat="server" />
            <!-- noi dung chinh -->
            <div class="wrap_info">
                <div class="row_info">
                    <div class="row_trai">
                        Tên đầy đủ</div>
                    <div class="row_phai">
                        <asp:TextBox ID="txt_fullName" CssClass="input" runat="server" MaxLength="50" onkeyup="valid(this,'special')" onblur="valid(this,'special')"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="txt_fullName_FilteredTextBoxExtender" runat="server"
                            InvalidChars="~!@#$%^&amp;*()-_+=|\{[}];:&quot;'&lt;&gt;?/" TargetControlID="txt_fullName"
                            FilterMode="InvalidChars">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </div>
                </div>
                <div class="row_info">
                    <div class="row_trai">
                        Email</div>
                    <div class="row_phai">
                        <asp:TextBox ID="txt_email" CssClass="input txtEmail" runat="server" MaxLength="50" onkeyup="valid(this,'email')" onblur="valid(this,'email')"></asp:TextBox>
                        <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator2" 
                          runat="server" ControlToValidate="txt_email" ErrorMessage="Email chưa đúng" 
                          ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>--%>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server"
                            InvalidChars="~!,#$%^&amp;*()-_+=|\{[}];:&quot;'&lt;&gt;?/" TargetControlID="txt_email"
                            FilterMode="InvalidChars">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </div>
                </div>
                <div class="row_info">
                    <div class="row_trai">
                        Tự giới thiệu</div>
                    <div class="row_phai">
                        <asp:TextBox ID="txt_intro" CssClass="input" runat="server" TextMode="MultiLine"
                            Height="191px" Width="439px" MaxLength="499" onkeyup="valid(this,'special')" onblur="valid(this,'special')"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server"
                            InvalidChars="~!@#$%^&amp;*()-_+=|\{[}];:&quot;'&lt;&gt;?/" TargetControlID="txt_intro"
                            FilterMode="InvalidChars">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </div>
                </div>
                <div class="row_info">
                    <div class="row_trai">
                        Hình đại diện</div>
                    <div class="row_phai">
                        <img id="avatar_in" runat="server" style="float: left" />
                        <div class="upA">
                            <asp:FileUpload ID="FileUpload1" runat="server" />
                            <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Chỉ chấp nhận file .jpg "
                                ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpg)$" ControlToValidate="FileUpload1"></asp:RegularExpressionValidator>--%>
                            <br />
                            <span>hình đại diện: jpeg</span>
                        </div>
                    </div>
                </div>
                <div class="row_info">
                    <div class="row_trai">
                        &nbsp;</div>
                    <div class="row_phai">
                        <asp:Button ID="btnLuuInfo" CssClass="button_V" runat="server" OnClientClick="return ktraEmail()"
                            Text="Lưu" OnClick="btnLuuInfo_Click" />
                    </div>
                </div>
            </div>
            <asp:Literal ID="litFil" runat="server"></asp:Literal>
            <div class="clear">
            </div>
            <!-- ket  thuc noi dung -->
            <div class="chiadoi">
                Thay đổi mật khẩu thường xuyên sẽ giúp bạn bảo mật tài khoản tốt hơn. <a id="thaydoimk"
                    href="#">Thay đổi mật khẩu</a></div>
            <!-- thay doi pass -->
            <div class="changePass">
                <div class="row_info">
                    <div class="row_trai morong">
                        Mật khẩu hiện tại</div>
                    <div class="row_phai">
                        <asp:TextBox ID="txt_curPs" CssClass="mk1" runat="server" MaxLength="50" TextMode="Password"></asp:TextBox>
                    </div>
                </div>
                <div class="row_info">
                    <div class="row_trai morong">
                        Mật khẩu mới</div>
                    <div class="row_phai">
                        <asp:TextBox ID="txt_mkMoi" CssClass="mk2" runat="server" MaxLength="50" TextMode="Password"></asp:TextBox>
                    </div>
                </div>
                <div class="row_info">
                    <div class="row_trai morong">
                        Xác nhận lại mật khẩu mới</div>
                    <div class="row_phai">
                        <asp:TextBox ID="txt_xacnhan" CssClass="mk3" runat="server" MaxLength="50" TextMode="Password"></asp:TextBox>
                    </div>
                </div>
                <div class="row_info">
                    <div class="row_trai morong">
                        &nbsp;<asp:Label ID="Label1" runat="server" Font-Size="Small" ForeColor="Red"></asp:Label>
                    </div>
                    <div class="row_phai">
                        <asp:Button ID="btn_change" CssClass="button_V" OnClientClick="return ktra()" runat="server"
                            Text="Lưu" OnClick="btn_change_Click" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var r = {
            'special': /['\\!@#$%^&*\()\{\}\[\]\"\b\/\|\+=_\-<>,;?']/g, ///[\W]/g,
            'quotes': /['\''&'\"']/g,
            'notnumbers': /[^\d]/g,
            'custum': /['\\!@#$%^&*\()\"\b\/\|\:+=_\-<>;.?']/g,
            'email': /['\\!#$%^&*\()\"\b\/\|\:+=_\-<>;?']/g
        }

        function valid(o, w) {
            o.value = o.value.replace(r[w], '');
        }
        $(document).ready(function () {
            $("#thaydoimk").click(function () {
                $('.changePass').toggle();
                return false;
            });
        });

        function checkTT() {
            if ($('.txtTieptuc').val() == "") {
                alert('Không được để trống ');
                $('.txtTieptuc').focus();
                return false;
            }
        }
        // ktra Email
        function ktraEmail() {
            var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
            var emailaddressVal = $(".txtEmail").val();
            if (!emailReg.test(emailaddressVal)) {
                alert("Email không hợp lệ! Mời bạn nhập lại email!");
                $(".txtEmail").focus();
                return false;
            }
            return true;
        }

        function ktra() {
            if ($(".mk1").val() == "") {
                alert('Nhập mật khẩu hiện tại');
                $(".mk1").focus();
                return false;
            } else if ($(".mk2").val() == "") {
                alert('Nhập mật khẩu mới');
                $(".mk2").focus();
                return false;
            } else if ($(".mk3").val() == "") {
                alert('Nhập lại mật khẩu mới');
                $(".mk3").focus();
                return false;
            }
        }
    </script>
</asp:Content>
